﻿@using Kairos.Views

@model Kairos.Models.Graphe

@{
    ViewBag.Title = "Edit";
}

@using (Html.BeginForm("Edit", "Graphe", new { id = Model.ID }, FormMethod.Post, new
    {
        enctype = "multipart/form-data"
    }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Graphe</legend>

        @Html.HiddenFor(model => model.ID)

        @Html.HiddenFor(model => model.DateCreation)
        @Html.HiddenFor(model => model.DateModification)

        @Html.HiddenFor(model => model.DateExpiration)

        @Html.HiddenFor(model => model.UserCreation)
        @Html.HiddenFor(model => model.UserModification)

        @Html.HiddenFor(model => model.Revision)

        @Html.HiddenFor(model => model.ImageID)

        <div class="editor-label">
            @Html.LabelFor(model => model.Titre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Titre)
            @Html.ValidationMessageFor(model => model.Titre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Image)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Image, new { type = "file" })
        </div>

        <div>
            <span class="display-label">Image actuelle :</span>
            <span class="display-field">
                @Html.ActionLink(Model.Image.FileName, "Details", "Image", new { id = Model.ImageID }, new { target = "_blank" })
            </span>
        </div>

        <hr />

        <table class="props">
            <tr>
                <td align="left">
                    <div>
                        @Html.ButtonLink("Annuler", "Details", new { id = Model.ID }, new { @class = "ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" })
                    </div>
                </td>
                <td align="right">
                    <div>
                        <input type="submit" value="Sauvegarder" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                    </div>
                </td>
            </tr>
        </table>

    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
